home *** CD-ROM | disk | FTP | other *** search
/ Java 1.1 Unleashed (3rd Edition) / Java 1.1 Unleashed Third Edition (1997)(SAMS.net)(Version 1.0).ISO / pc / 3rdparty / html / incntxt / webizer / win32s.2 / weban / TRIAL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-03  |  3.0 KB  |  93 lines

  1. /****************************************************************************
  2.  * trial.h - exported entry points into the 32 bit Trialware DLL
  3.  ****************************************************************************
  4.  * This module, both in source and in binary format, is wholly owned
  5.  *          and hereby expressly copyrighted by Pipeline.
  6.  *        Copyright 1994-1996 Pipeline Communications, Inc.
  7.  *                      All rights reserved.
  8.  ****************************************************************************/
  9. #ifndef _TRIAL_H
  10. #define _TRIAL_H
  11. // trialware status structure
  12. // used for returns
  13.  
  14. #if defined(__cplusplus)
  15. extern "C" {
  16. #endif
  17.  
  18. typedef struct _tw_status
  19. {
  20.    DWORD    dwMisc;
  21.    DWORD    dwFlags;
  22.    DWORD    dwDaysLeft;
  23.    DWORD    dwTimeLeft;
  24.    DWORD    dwExpDate;
  25.    DWORD dwToken;
  26.    HINSTANCE hInst;
  27. } TWSTATUS;
  28.  
  29. typedef TWSTATUS * PTWSTATUS;
  30.  
  31. #define PLTW_SECURE           (0x00000001)
  32. #define PLTW_SET_DATE         (0x00000002)
  33. #define PLTW_SET_DAYS         (0x00000004)
  34. #define PLTW_ADD_DAYS         (0x00000010)
  35. #define PLTW_NO_ORDER         (0x00000020)
  36. #define PLTW_ORDER_EXE        (0x00000040)
  37. #define PLTW_NO_RESOURCE      (0x00000080)
  38. #define PLTW_READ_ONLY        (0x00000100)
  39. #define PLTW_UNLOCK           (0x00000200)
  40. #define PLTW_FROMORDER        (0x00010000)
  41.  
  42. // Warning! TW_FAILURE is now removed
  43. // It was misused.  There was no distinction between a
  44. // failed API and EXPIRED trialware.  
  45. // 
  46. // NOW!!! TW_EXPIRED is returned if the trialware is expired. 
  47. //        Since much code relied on the return value of 0 (zero)
  48. //          to indicated expired, TW_EXPIRED is 0 
  49. //          This way the .dll will be somewhat run time compatible.      
  50.  
  51. // Since TW_FAILURE has been changed to a new VALUE: -1 
  52. // and is really now representative of an ERROR, NOT EXPIRED
  53. // I purposely undefined TW_FAILURE to produce compile errors.  
  54. // This will give the programmer cause to check the usage of 
  55. // TW_FAILURE in his code and whether he really needs to use 
  56. // TW_EXPIRED or TW_FAILED.  
  57. //
  58. // Scott Russell 
  59. // 4-6-96
  60.  
  61. #define TW_INVALID_PARAM      (-1)
  62. #define TW_FAILED              (-1)
  63. #pragma message( "Warning!  Trial.dll return codes have changed, See Trial.h Comments" )
  64. // #define TW_FAILURE          (0)
  65. #define TW_EXPIRED            (0)   // errors are <= 0
  66. #define TW_SUCCESS            (1)
  67. #define TW_UNLOCKED           (2)
  68.  
  69. // function prototypes
  70. // alias the names of the api
  71. #define StartTrial   PLSTW
  72. #define TestTrial    PLTTW
  73. #define EndTrial     PLETW
  74. int StartTrial(LPCSTR szLogin, PTWSTATUS stat);
  75. int TestTrial(LPCSTR szLogin, PTWSTATUS stat);
  76. int EndTrial(LPCSTR szLogin, PTWSTATUS stat);
  77.  
  78. // macro for decoding secure return
  79.  
  80. #define XCODE(token, encret, ret) \
  81.          {  BYTE *f = (BYTE *)&(token); \
  82.             BYTE *t = (BYTE *)&(encret); \
  83.                 int i;   \
  84.             for (i = 0; i < 4; i++) \
  85.                *(t+i) = *(f+i) ^ (ret); \
  86.          }
  87.  
  88. #if defined(__cplusplus)
  89. }
  90. #endif
  91.  
  92. #endif
  93.